// This is the main DLL file.

#include "stdafx.h"

#include "MotionDetectorWrapper.h"

MotionDetectorWrapper::MotionDetector::MotionDetector()
{
	pDetector = new CMotionDetcterClassDll();
}

MotionDetectorWrapper::MotionDetector::~MotionDetector()
{
	if (pDetector)
	{
		delete pDetector;
	}
}

int MotionDetectorWrapper::MotionDetector::FindObject(OpenCvSharp::IplImage^ image,OpenCvSharp::CvRect  roi)
{
	CvRect tempRoi;
	tempRoi.height = roi.Height;
	tempRoi.width = roi.Width;
	tempRoi.x = roi.X;
	tempRoi.y = roi.Y;

	return pDetector->FindObject((IplImage*) image->CvPtr.ToPointer(),tempRoi);
}

// OpenCvSharp::CvRect MotionDetectorWrapper::MotionDetector::GetTrackObjRect()
// {
// 	CvRect rect = pDetector->GetTrackObjRect();
// 
// 	OpenCvSharp::CvRect managedRect;
// 	managedRect.X = rect.x;
// 	managedRect.Y = rect.y;
// 	managedRect.Width = rect.width;
// 	managedRect.Height = rect.height;
// 
// 	return managedRect;
// }

